home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Program TestRealModeMemoryAccess;
-
-
- {Test the Real_Mem unit by displaying the COM and LPT port base addresses from the
- BIOS area (0040h:0000h). No error trapping.
-
-
-
- Rex K. Perkins, CIS 70651,1611
-
- 10th April 1992}
-
-
-
- Uses WinCRT,Real_Mem;
-
- Const HexChars:String='01234567890ABCDEF'; {Hex digits. Hey, it works!}
-
- Var MemoryArray:PRealSegment;
- Count:Word;
-
-
-
- Begin
- MemoryArray:=GetRealSegment($0040); {Get a pointer to the BIOS area}
- If MemoryArray<>Nil Then {Don't dereference a nil pointer}
- Begin
- For Count:=0 To 3 Do {Display COM port addresses}
- WriteLn('COM',Count+1,': ',HexChars[1+MemoryArray^[1+(Count SHL 1)] SHR 4],
- HexChars[1+MemoryArray^[1+(Count SHL 1)] AND $F],
- HexChars[1+MemoryArray^[Count SHL 1] SHR 4],
- HexChars[1+MemoryArray^[Count SHL 1] AND $F]);
-
- WriteLn;
-
- For Count:=0 To 3 Do {Display LPT port addresses}
- WriteLn('LPT',Count+1,': ',HexChars[1+MemoryArray^[9+(Count SHL 1)] SHR 4],
- HexChars[1+MemoryArray^[9+(Count SHL 1)] AND $F],
- HexChars[1+MemoryArray^[8+(Count SHL 1)] SHR 4],
- HexChars[1+MemoryArray^[8+(Count SHL 1)] AND $F])
- End
- End.
-
-